import Vue from 'vue';
import Vuex from 'vuex';
 
Vue.use(Vuex);
 
const store = new Vuex.Store({
 state: {
 	userInfo: null,
 	token: '',
 	tempUser: {},
 	kf: '' // 客服电话
 },
 mutations: {
 	saveUserInfo(state, user) {
 		state.userInfo = user;
 	},
 	saveToken(state, token) {
 		state.token = token;
 		uni.setStorageSync("sstoken", token)
 	},
 	saveTempUser(state, user) {
 		state.tempUser = user
 	},
 	saveKF(state, mobile) {
 		state.kf = mobile
 	}
 },
});
 
export default store;

